import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store, { key } from './store'
import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
import installElementPlus, { Size } from './plugins/element'

const app = createApp(App)
import 'normalize.css/normalize.css'

import '@/styles/index.scss'

import initSvgIcon from '@/icons/index.ts'

const size = store.state.app.size

declare module '@vue/runtime-core' {
  interface ComponentCustomProperties {
    $message: typeof ElMessage
    $notice: typeof ElNotification
    $confirm: typeof ElMessageBox.confirm
    $alert: typeof ElMessageBox.confirm,
    $prompt: typeof ElMessageBox.prompt
    $ELEMENT: {
      size: Size
    }
  }
}

app.use(store, key).use(router).use(installElementPlus, { size }).use(initSvgIcon).mount('#app')
